<%//@ include file="../include/eproAuthorization.jsp"%>
<%@ page  
	errorPage="../include/eproErrorPage.jsp"
	contentType="text/html; charset=windows-874" 
	import=		"com.epro.standard.frontend.util.FileInfoUtil,
            com.epro.standard.frontend.util.ShowData,java.util.Vector,
            com.softplus.carrefour.hd.bltier.entity.UserOfficeHour,
            com.softplus.carrefour.hd.bltier.entity.UserLevel"
%>
<%
  // com.softplus.carrefour.hd.bltier.manage.*
%>
<HTML xmlns:epro>
<%@ taglib uri="/WEB-INF/HeadTag.tld" prefix="head"%>
<%@ taglib uri="/WEB-INF/ToolbarTag.tld" prefix="toolbar"%>
<%@ taglib uri="/WEB-INF/TextfieldTag.tld" prefix="textfield"%>
<%@ taglib uri="/WEB-INF/TextareaTag.tld" prefix="textarea"%>
<%@ taglib uri="/WEB-INF/ListboxTag.tld" prefix="listbox"%>
<%@ taglib uri="/WEB-INF/LovButtonTag.tld" prefix="lovbutton"%>
<%@ taglib uri="/WEB-INF/CheckboxTag.tld" prefix="CheckboxTag"%>

<head:Head 
	author="MAX" 
	title="User's Office Hour(s) Setup : View"
	import="toolbar,textfield,textarea,listbox,button,checkbox"
	jsFile="../script/imgProp.js,../script/Alert.js,../script/checkValidData.js,../script/lov.js"
	styleFile ="../theme/defaultTheme.css"></head:Head>
<%
    String textfieldWidth 	      = "280";
    String textTimeWidth          = "50" ;
    String listBoxWidth           = "280" ;
    String lovWidth               = "50";
   	String lovDescWidth   	      = "230";
    String masterWidth            = com.epro.standard.frontend.datasetup.MessageManager.getMasterWidth();
    String linkParameter	        = "" ; //"?countryIDShow="+countryID+"&radioTypeShow="+radioType;

    ShowData         showData 	  = new ShowData();
        
    int              index        = Integer.parseInt(request.getParameter("index")) - 1 ;
    UserOfficeHour   uhEntity     = (UserOfficeHour) ((Vector)session.getAttribute("OfficeHourManagerVector")).elementAt(index) ;
    UserLevel        ul           = new UserLevel() ;
    
    // ---------------- Display Data ------------------------
    String countryName      = showData.CheckNull(uhEntity.getCountry().getCountryName()) ;
    String userLevelName    = ul.getLevelName(uhEntity.getComp_id().getUlevel()) ;
    String fromHour         = uhEntity.getOprHourStart().substring(0,2) ;
    String fromMinute       = uhEntity.getOprHourStart().substring(2) ;
    String toHour           = uhEntity.getOprHourEnd().substring(0,2) ;
    String toMinute         = uhEntity.getOprHourEnd().substring(2) ;
    String sundayCheck      = uhEntity.isSun()?"true":"false" ;
    String mondayCheck      = uhEntity.isMon()?"true":"false" ;
    String tuesdayCheck     = uhEntity.isTue()?"true":"false" ;
    String wednesdayCheck   = uhEntity.isWed()?"true":"false" ;
    String thursdayCheck    = uhEntity.isThu()?"true":"false" ;
    String fridayCheck      = uhEntity.isFri()?"true":"false" ;
    String saturdayCheck    = uhEntity.isSat()?"true":"false" ;
    String updateBy         = showData.CheckNull(uhEntity.getUpdBy()) ;
    String updateDate       = showData.CheckNull(uhEntity.getUpdDate(), "dd/MM/yyyy") ;
%>
<script>
  function disableCheckbox()
  {
    for(i=0; i<frm.workingDay.length; i++)
    {
      frm.workingDay[i].disabled = true ;
    }
  }
</script>
<%//@ include file="../include/eproPopupJsp.jsp"%>
<%@ include file="../include/toolbarHint.jsp"%>
<BODY onload="disableCheckbox();">
<DIV style="width:100%;height:90%;margin:5px" class="modalBg">
<%//@ include file="../include/eproPopupToolbar.jsp"%>
   <FORM name="frm" action="<%//= ((FileInfoUtil) session.getAttribute("fileInfoUtil")).getServletURL()+linkParameter %>" method="post" onsubmit="submitForm();return false;">
			<TABLE align="center" width="80%">
      
        <TR>
          <TD colspan="3">
            <img alt="<%=exitHint%>" src="../images/icon/toolbar/nExit.gif" onmouseover="this.src='../images/icon/toolbar/oExit.gif'" onmouseout="this.src='../images/icon/toolbar/nExit.gif'" style="cursor:hand" onclick="window.close();">
          </TD>
        </TR>
        
			  <TR>
			    <TD width="40%" align="right" valign="top" class="titleFont">Country : </TD>
          <TD width="5"></TD>
          <TD class="dataDetailPK"><textfield:textfield  name="countryName" width="<%=textfieldWidth%>" readonly="yes" value="<%=countryName%>"></textfield:textfield></TD>
		    </TR>

        <TR>
          <TD align="right" valign="top" class="titleFont">User Level : </TD>
          <TD width="5"></TD>
          <TD class="dataDetailPK"><textfield:textfield  name="userLevelName" width="<%=textfieldWidth%>" readonly="yes" value="<%=userLevelName%>"></textfield:textfield></TD>
        </TR>
        
        <TR>
          <TD colspan="3" align="center">
            <FIELDSET class="titleFont" style="text-align: right;width: 430px;margin-left: 58px;"><LEGEND class="borderFontHeadOfWorkingTime">Office Hour(s)</LEGEND>
              <TABLE  width="100%" cellspacing="0" cellpadding="3">
                <TR>
                  <TD width="30%" align="right" valign="top" class="titleFont">From :</TD>
                  <TD width="5"></TD>
                  <TD class="dataDetailPK">
                    <textfield:textfield  name="StartTimeHours" align="right" width="<%=textTimeWidth%>" readonly="yes" value="<%=fromHour%>" dataType="integer"/>
                    &nbsp;  :  &nbsp;
                    <textfield:textfield  name="StartTimeMinutes" align="right" width="<%=textTimeWidth%>" readonly="yes" value="<%=fromMinute%>" dataType="integer"/>
                  </TD>
                  <TD>&nbsp;</TD>
                </TR>          
                <TR>
                  <TD width="30%" align="right" valign="top" class="titleFont">To :</TD>
                  <TD width="5"></TD>
                  <TD class="dataDetailPK">
                    <textfield:textfield  name="EndTimeHours" align="right" width="<%=textTimeWidth%>" readonly="yes" value="<%=toHour%>" dataType="integer"/>
                    &nbsp;  :  &nbsp;
                    <textfield:textfield  name="EndTimeMinutes" align="right" width="<%=textTimeWidth%>" readonly="yes" value="<%=toMinute%>" dataType="integer"/>
                  </TD>
                  <TD>&nbsp;</TD>
                </TR>
              </TABLE>
            </FIELDSET>
          </TD>
        </TR>
              
        <TR>
          <TD colspan="3" align="center">
            <FIELDSET class="titleFont" style="text-align: right;width: 430px;margin-left: 58px;"><LEGEND class="borderFontHeadOfWorkingTime">Working Day</LEGEND>
              <TABLE  width="100%" cellspacing="0" cellpadding="3">
                <TR>
                  <TD width="30%" align="right" valign="top" class="titleFont"></TD>
                  <TD width="5"></TD>
                  <TD class="dataDetailPK">
                    <CheckboxTag:checkbox name="workingDay" label="Sunday" check="<%=sundayCheck%>"/><BR>
                    <CheckboxTag:checkbox name="workingDay" label="Monday" check="<%=mondayCheck%>"/><BR>
                    <CheckboxTag:checkbox name="workingDay" label="Tuesday" check="<%=tuesdayCheck%>"/><BR>
                    <CheckboxTag:checkbox name="workingDay" label="Wednesday" check="<%=wednesdayCheck%>"/><BR>
                    <CheckboxTag:checkbox name="workingDay" label="Thursday" check="<%=thursdayCheck%>"/><BR>
                    <CheckboxTag:checkbox name="workingDay" label="Friday" check="<%=fridayCheck%>"/><BR>
                    <CheckboxTag:checkbox name="workingDay" label="Saturday" check="<%=saturdayCheck%>"/><BR>
                  </TD>
                  <TD>&nbsp;</TD>
                </TR>
              </TABLE>
            </FIELDSET>
          </TD>
        </TR>

        <TR>
          <TD align="right" valign="top" class="titleFont">Update By : </TD>
          <TD width="5"></TD>
          <TD class="dataDetailPK"><textfield:textfield  name="txtUpdateBy" width="<%=textfieldWidth%>" readonly="yes" value="<%=updateBy%>"></textfield:textfield></TD>
        </TR>
        
        <TR>
          <TD align="right" valign="top" class="titleFont">Update Date : </TD>
          <TD width="5"></TD>
          <TD class="dataDetailPK"><textfield:textfield  name="txtUpdateDate" width="<%=textfieldWidth%>" readonly="yes" value="<%=updateDate%>"></textfield:textfield></TD>
        </TR>
        
      </TABLE>
    </FORM>
</DIV>
</BODY>
</HTML>
